const {ccclass, property} = cc._decorator;

@ccclass
export default class tankEnemy extends cc.Component {

    // LIFE-CYCLE CALLBACKS:

    	
    private animationComponent:cc.Animation

    onLoad () {
        
        // 调用动画
        this.animationComponent = this.getComponent(cc.Animation);
    }

    start () {

    }

    update (dt) {

    }

    // 敌人死亡方法
    die() {
        // 用获取的组件执行动画
        this.animationComponent.play('boom');
        this.animationComponent.on('stop', (event) => {
            // 处理停止播放时的逻辑
            this.node.destroy();
        }, this);
    }
}
